<template>
  <div>
    <!-- 顶部 -->
    <MyTote />
    <!-- 停车区域分布图 -->
    <MyProfile />
    <!-- 用户增长分布图 -->
    <MyGrowth />
    <!-- 上报单位 -->
    <MyReported @parent="parentSearch" />
    <!-- 表格 -->
    <MyCondition :myarr="arr" @delTable="initBackstage" />
  </div>
</template>

<script>
import { getBackstageApi } from "../../api/backstageApi";
import MyTote from "./components/MyTote.vue";
import MyProfile from "./components/MyProfile.vue";
import MyGrowth from "./components/MyGrowth.vue";
import MyReported from "./components/MyReported.vue";
import MyCondition from "./components/MyCondition.vue";

export default {
  components: {
    MyTote,
    MyProfile,
    MyGrowth,
    MyReported,
    MyCondition,
  },
  data() {
    return {
      arr: [],
      keyword: "",
    };
  },
  mounted() {
    this.initBackstage();
  },
  methods: {
    parentSearch(val) {
      this.keyword = val;
      this.initBackstage();
    },
    initBackstage() {
      var params = { keyword: this.keyword };
      getBackstageApi(params).then((res) => {
        console.log(res);
        if (res.code == 200) {
          this.arr = res.data;
        }
      });
    },
  },
};
</script>

<style></style>
